﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;

namespace QASampling.QAControl
{
    public partial class QAComboBox : ComboBox
    {
        public QAComboBox()
        {
            InitializeComponent();
        }

        private void QAComboBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (Char.IsDigit(e.KeyChar))
            {
                int key = (int)Char.GetNumericValue(e.KeyChar);
                this.SelectedIndex = key <= this.Items.Count ? key-1 : this.SelectedIndex;
            }
        }


    }
}
